package Colonia;

public class Arista 
{
	private Integer codigo;
	private Vertice origen;
	private Vertice destino;
	private Double feromona;
	
	public Arista(Integer codigo, Vertice origen, Vertice destino, Double feromona) 
	{
		this.codigo = codigo;
		this.origen = origen;
		this.destino = destino;
		this.feromona = feromona;
	}

	public Integer getCodigo() 
	{
		return codigo;
	}

	public Vertice getOrigen() 
	{
		return origen;
	}

	public Vertice getDestino() 
	{
		return destino;
	}

	public Double getFeromona() 
	{
		return feromona;
	}

	public void setFeromona(Double feromona)
	{
		this.feromona = feromona;
	}
	
	public int hashCode() 
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
		return result;
	}

	public boolean equals(Object obj) 
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Arista other = (Arista) obj;
		if (codigo == null) {
			if (other.codigo != null)
				return false;
		} else if (!codigo.equals(other.codigo))
			return false;
		return true;
	}
	
	public String toString()
	{
		String ret = "";
		
		ret += this.origen.getCodigo() + "-" + this.destino.getCodigo();
		
		return ret;
	}
}
